package edu.zzuli.model.dao.hibernate;

import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.dao.DataAccessException;

import edu.zzuli.model.dao.BasePO;

/**
 * @author tianshaojie
 * @date 2010-12-12
 * @discription :
 */
public interface HibernateDao {
	
	public abstract void save(BasePO paramBasePO) throws DataAccessException;

	public abstract int save(List<BasePO> paramList) throws DataAccessException;

	public abstract void update(BasePO paramBasePO) throws DataAccessException;

	public abstract void update(List<BasePO> paramList) throws DataAccessException;

	public abstract void update(BasePO paramBasePO, StringBuffer paramStringBuffer) throws DataAccessException;

	public abstract void delete(BasePO paramBasePO) throws DataAccessException;

	public abstract void delete(List<BasePO> paramList) throws DataAccessException;

	public abstract void delete(BasePO paramBasePO, StringBuffer paramStringBuffer) throws DataAccessException;
	
	public abstract BasePO selectSingle(BasePO paramBasePO) throws DataAccessException;

	public abstract List select(BasePO paramBasePO) throws DataAccessException;

	/**
	 * @author tianshaojie
	 * @date 2011-7-16
	 * @discription : Hibernate单表分页查询
	 * @param paramBasePO	
	 * @param firstResult	开始位置	rows * (page - 1);
	 * @param maxResult		每页条数	rows
	 * @return
	 * @throws DataAccessException List
	 */
	public abstract List selectSplit(BasePO paramBasePO, final int firstResult,final int maxResult) throws DataAccessException;

	public abstract List selectExact(BasePO paramBasePO) throws DataAccessException;

	public abstract List selectExact(BasePO paramBasePO, StringBuffer paramStringBuffer) throws DataAccessException;

	public abstract List calculate(BasePO paramBasePO, String paramString, StringBuffer paramStringBuffer) throws DataAccessException;

	public abstract List calculate(BasePO paramBasePO, String paramString) throws DataAccessException;

	public abstract void exeSql(StringBuffer paramStringBuffer) throws DataAccessException;

	public abstract HibernateDao getFromApplicationContext(ApplicationContext paramApplicationContext);
	
	public abstract List loadAll(final Class entityClass) throws DataAccessException;

	public abstract List loadAll(final Class entityClass, final int firstResult,final int maxResult) throws DataAccessException;
	
	public abstract List findByCriterions(Class clazz, List restrictions)throws DataAccessException;

	public abstract List findByCriterions(Class clazz, List restrictions,int firstResult, int maxResult) throws DataAccessException;
}
